package com.eleventwelve.iris.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.opentides.bean.Auditable;
import org.opentides.bean.AuditableField;
import org.opentides.bean.BaseEntity;
import org.opentides.bean.Searchable;
import org.opentides.bean.Sortable;

/**
 * 
 * @author Ashley
 *
 */
@Entity
@Table(name="MEDICINE")
public class Medicine extends BaseEntity implements Searchable, Sortable, Auditable{
	private static final long serialVersionUID = 298960310767068563L;
	
	@Column(name="NAME")
	private String name;
	
	@Lob
	@Column(name = "DESCRIPTION")
	private String description;
	
	@Lob
	@Column(name = "PRECAUTION")
	private String precaution;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPrecaution() {
		return precaution;
	}

	public void setPrecaution(String precaution) {
		this.precaution = precaution;
	}

	@Override
	public AuditableField getPrimaryField() {
		return new AuditableField("name");
	}
	
	@Override
	public List<AuditableField> getAuditableFields() {
		List<AuditableField> auditableFields = new ArrayList<AuditableField>();
		auditableFields.add(new AuditableField("name"));
		return auditableFields;
	}

	@Override
	public List<String> getSearchProperties() {
		List<String> searchProperties = new ArrayList<String>();
		searchProperties.add("name");
		return searchProperties;
	}

}
